﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.UI.WebControls;

namespace BugTracker.BTGridView
{
    [Serializable]
    public sealed class Sorter
    {
        public string Column { get; set; }
        public SortDirection SortDirection { get; set; }

        public Sorter()
        {
            Column = string.Empty;
            SortDirection = SortDirection.Ascending;
        }

        public Sorter(string column, SortDirection sortDirection)
        {
            Column = column;
            SortDirection = sortDirection;
        }

        public string GetDirection()
        {
            string direction = "ASC";
            switch (this.SortDirection)
            {
                case SortDirection.Ascending:
                    direction = "ASC";
                    break;
                case SortDirection.Descending:
                    direction = "DESC";
                    break;
            }
            return direction;
        }

    }
}
